package com.csit.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="T_CardCharge")
public class CardCharge implements Serializable {
	
	private static final long serialVersionUID = -7811855692010368329L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Integer chargeID;
	
	@Temporal(TemporalType.DATE)
	private Date chargeDate;
	
	@Column(precision=2)
	private Double actualAmount;
	
	@Column(precision=2)
	private Double freeAmount;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="handlerID",updatable=false)
	private User operate;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="cardID")
	private CustomerCard customerCard;

	public Integer getChargeID() {
		return chargeID;
	}

	public void setChargeID(Integer chargeID) {
		this.chargeID = chargeID;
	}

	public Date getChargeDate() {
		return chargeDate;
	}

	public void setChargeDate(Date chargeDate) {
		this.chargeDate = chargeDate;
	}

	public Double getActualAmount() {
		return actualAmount;
	}

	public void setActualAmount(Double actualAmount) {
		this.actualAmount = actualAmount;
	}

	public Double getFreeAmount() {
		return freeAmount;
	}

	public void setFreeAmount(Double freeAmount) {
		this.freeAmount = freeAmount;
	}

	public User getOperate() {
		return operate;
	}

	public void setOperate(User operate) {
		this.operate = operate;
	}

	public CustomerCard getCustomerCard() {
		return customerCard;
	}

	public void setCustomerCard(CustomerCard customerCard) {
		this.customerCard = customerCard;
	}
	
}
